package com.cangshukj.web.controller.junong;

import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cangshukj.common.annotation.Log;
import com.cangshukj.common.core.controller.BaseController;
import com.cangshukj.common.core.domain.AjaxResult;
import com.cangshukj.common.enums.BusinessType;
import com.cangshukj.junong.domain.IncubatorsReginfo;
import com.cangshukj.junong.service.IIncubatorsReginfoService;
import com.cangshukj.common.utils.poi.ExcelUtil;
import com.cangshukj.common.core.page.TableDataInfo;

/**
 * 孵化地基-登记信息Controller
 * 
 * @author wangjie
 * @date 2025-04-01
 */
@Api(value = "/incubators/reginfo",description = "孵化地基-登记信息")
@RestController
@RequestMapping("/incubators/reginfo")
public class IncubatorsReginfoController extends BaseController
{
    @Autowired
    private IIncubatorsReginfoService incubatorsReginfoService;

    /**
     * 查询孵化地基-登记信息列表
     */
    @ApiOperation("查询孵化地基-登记信息列表")
    @PreAuthorize("@ss.hasPermi('incubators:reginfo:list')")
    @GetMapping("/list")
    public TableDataInfo list(IncubatorsReginfo incubatorsReginfo)
    {
        startPage();
        List<IncubatorsReginfo> list = incubatorsReginfoService.selectIncubatorsReginfoList(incubatorsReginfo);
        clearPage();
        return getDataTable(list);
    }


    /**
     * 获取孵化地基-登记信息详细信息
     */
    @ApiOperation("获取孵化地基-登记信息详细信息")
    @PreAuthorize("@ss.hasPermi('incubators:reginfo:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(incubatorsReginfoService.selectIncubatorsReginfoById(id));
    }

    /**
     * 新增孵化地基-登记信息
     */
    @ApiOperation("新增孵化地基-登记信息")
    @PreAuthorize("@ss.hasPermi('incubators:reginfo:add')")
    @Log(title = "孵化地基-登记信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody IncubatorsReginfo incubatorsReginfo)
    {
        incubatorsReginfo.setCreateBy(getUsername());
        incubatorsReginfo.setCreateTime(new Date());
        return toAjax(incubatorsReginfoService.insertIncubatorsReginfo(incubatorsReginfo));
    }

    /**
     * 修改孵化地基-登记信息
     */
    @ApiOperation("修改孵化地基-登记信息")
    @PreAuthorize("@ss.hasPermi('incubators:reginfo:edit')")
    @Log(title = "孵化地基-登记信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody IncubatorsReginfo incubatorsReginfo)
    {
        incubatorsReginfo.setUpdateTime(new Date());
        incubatorsReginfo.setUpdateBy(getUsername());
        return toAjax(incubatorsReginfoService.updateIncubatorsReginfo(incubatorsReginfo));
    }

    /**
     * 删除孵化地基-登记信息
     */
    @ApiOperation("删除孵化地基-登记信息")
    @PreAuthorize("@ss.hasPermi('incubators:reginfo:remove')")
    @Log(title = "孵化地基-登记信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(incubatorsReginfoService.deleteIncubatorsReginfoByIds(ids));
    }
}
